<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>
        <f:view>
            <ui:composition template="./templates/default.xhtml">

                <ui:define name="top">
                    #{msgs.title_registration}
                </ui:define>

                <ui:define name="content">

                    <h:panelGroup>
                        <h:messages globalOnly="true" infoStyle="color: green" errorStyle="color: red" />
                    </h:panelGroup>

                    <h:form id="registerForm">
                        <h:messages for="personalIdNumber" errorStyle="color: red" />
                        <h:outputLabel value="#{msgs.label_personal_id_number}" for="personalIdNumber"/>
                        <br />
                        <h:inputText id="personalIdNumber" value="#{registerView.person.personalIdNumber}" />
                        <br />
                        <h:messages for="firstName" errorStyle="color: red" />
                        <h:outputLabel value="#{msgs.label_first_name}" for="firstName"/>
                        <br />
                        <h:inputText id="firstName" value="#{registerView.person.firstName}" />
                        <br />
                        <h:messages for="lastName" errorStyle="color: red" />
                        <h:outputLabel value="#{msgs.label_last_name}" for="lastName"/>
                        <br />
                        <h:inputText id="lastName" value="#{registerView.person.lastName}" />
                        <br />
                        <h:messages for="email" errorStyle="color: red" />
                        <h:outputLabel value="#{msgs.label_email}" for="email"/>
                        <br />
                        <h:inputText id="email" value="#{registerView.person.email}" />
                        <br />
                        <h:messages for="user" errorStyle="color: red" />
                        <h:outputLabel value="#{msgs.label_username}" for="user"/>
                        <br />
                        <h:inputText id="user" value="#{registerView.user.username}" />
                        <br />
                        <h:messages for="password" errorStyle="color: red" />
                        <h:outputLabel value="#{msgs.label_password}" for="password"/>
                        <br />
                        <h:inputSecret id="password" value="#{registerView.password}" />
                        <br />
                        <h:commandButton id="register" value="#{msgs.button_register}" action="#{registerView.register()}"/>
                    </h:form>

                </ui:define>

            </ui:composition>
        </f:view>
    </body>
</html>
